<?php
$guestbook = new DomDocument(); //创建一个新的 DOM对象 
$guestbook->load('DB/guestbook.xml');
 
$root = $guestbook->documentElement;
$res = $root->getElementsByTagName('thread');
foreach ($res as  $value) {
	if($value->id==$_POST['id']){
		$root -> removeChild($value);
	}
}

$guestbook -> save('DB/guestbook.xml');

header('Location: ./index.php');
?>